<template>
	<view class="">
		<Navbar :isReturn="true"></Navbar>
		<view v-if="type == '9'" class="u-m-30">
			<u-parse :html="content" :selectable="true" :tag-style="style"
				:lazy-load="true"></u-parse>
		</view>
		<view v-else class="u-p-30">
			<!-- <rich-text :nodes="content" preview="true"></rich-text> -->
			<u-parse :html="content"></u-parse>
		</view>
		<view style="height: 200rpx;"></view>
		<Bottom :isReturn="true" :backUrl="backUrl"></Bottom>
	</view>
</template>

<script>
	import {
		getAgreement
	} from "@/network/api.js"
	import Navbar from '@/components/Navbar.vue'
	import Bottom from '@/components/Bottom.vue'
	import { formatContent } from '@/utils/index.js'
	export default {
		components: {
			Navbar,
			Bottom
		},
		data() {
			return {
				content: "",
				type: "",
				backUrl: ""
			}
		},
		onLoad(options) {
			this.type = options.type
			if(options.back) this.backUrl = options.back
			this.handleGetAggreement(options.type)
		},
		methods: {
			handleGetAggreement(type) {
				getAgreement({
					type: type
				}).then(res => {
					this.content = formatContent(res.data.content)
				})
			}
		}
	}
</script>

<style lang="scss">
</style>
